package com.cn.ycy.quartz;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.SchedulerException;

import java.time.LocalDateTime;

public class HelloJob2 implements Job {

  @Override
  public void execute(JobExecutionContext context) throws JobExecutionException {
    Object tv1 = context.getTrigger().getJobDataMap().get("cronTriggerKey");
//    Object tv2 = context.getTrigger().getJobDataMap().get("t2");
    Object jv1 = context.getJobDetail().getJobDataMap().get("j1");
    Object jv2 = context.getJobDetail().getJobDataMap().get("j2");
    Object sv = null;
    try {
      sv = context.getScheduler().getContext().get("skey");
    } catch (SchedulerException e) {
      e.printStackTrace();
    }
//    System.out.println(tv1+":"+tv2);
    System.out.println(tv1);
    System.out.println(jv1+":"+jv2);
    System.out.println(sv);
    System.out.println("hello2:"+ LocalDateTime.now());
  }
}
